<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="node_modules/vue/dist/vue.js"></script>
</head>

<body>
    <div id="app">
        <input type="text" v-model="num">
        <button v-on:click="num++">点我</button>
        <h2>{{name}}非常帅!有{{num}}个学科.</h2>
        <button v-on:click="add">点我</button>
    </div>
    <script>
        var app = new Vue({
            el: "#app",
            data: {
                name: "曾晨",
                num: 1
            },
            methods:{
                add: function () {
                    console.log("点击了...")
                },
            }
        });
    </script>

</body>

</html>